package com.app.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.app.feign.fallback.CalculateApiFallBack;

/**
 * Created by xujingfeng on 2017/8/3.
 */
@FeignClient(value = "calculate",path = "/api",fallback = CalculateApiFallBack.class)
public interface CalculateApi {

    @GetMapping(path = "/hehehe")
    Integer hehehe(@RequestParam("a") Integer a, @RequestParam("b") Integer b);

    @PostMapping(path = "/add")
    Integer add(@RequestParam("a") Integer a, @RequestParam("b") Integer b);

    @PostMapping(path = "/subtract")
    Integer subtract(@RequestParam("a") Integer a, @RequestParam("b") Integer b);

}
